package com.example.demo.mapstudy;

import java.util.*;

/**
 * @Description MapAndColectionDemo
 * @Author songchuanlong
 * @Date 2025-05-17
 */
public class MapAndColectionDemo {
    public static void main(String[] args) {
        /**
         * 江苏省=“南京市”，"扬州市”，“苏州市”，"无锡市”，“常州市”
         * 湖北省=“武汉市”，“孝感市”，“十堰市”，“宜昌市”，“鄂州市”
         * 河北省“石家庄市”，“唐山市”，“邢台市”，“保定市”，“张家口市”
         */
        Map<String, List<String>> map = new HashMap<>();
        List<String> jiangsu = new ArrayList<>();
        List<String> hubei = new ArrayList<>();
        List<String> hebei = new ArrayList<>();
        Collections.addAll(jiangsu,"南京市","扬州市","苏州市","无锡市","常州市");
        Collections.addAll(hubei,"武汉市","孝感市","十堰市","宜昌市","鄂州市");
        Collections.addAll(hebei,"石家庄市","唐山市","邢台市","保定市","张家口市");
        map.put("江苏省",jiangsu);
        map.put("湖北省",hubei);
        map.put("河北省",hebei);
        System.out.println(map);
        map.forEach((k,v)->{
            System.out.println(k+"=>"+v);
        });

    }
}
